package chess;

import java.util.ArrayList;
import java.util.List;

public class Board {

		static final int width  = 7;
		static final int height = 7;
		
    	static final int WHITE	= 0;
		static final int BLACK	= 1;
	
		static final int KING   = 0;
		static final int RUNNER = 1;
		static final int HORSE  = 2;
		static final int QUEEN	= 3;
		static final int PAWN	= 4;
		static final int TOWER	= 5;
			

	
	private List<Figure> figures;
	
	int[][] initializationList = { 
			{WHITE,TOWER,0,0},
			{WHITE,TOWER,7,0},
			{WHITE,KING,3,0},
			{WHITE,HORSE,1,0},
			{WHITE,HORSE,6,0},
			{WHITE,QUEEN,4,0},
			{WHITE,RUNNER,2,0},
			{WHITE,RUNNER,5,0},
			{WHITE,PAWN,0,2},
			{WHITE,PAWN,1,2},
			{WHITE,PAWN,2,2},
			{WHITE,PAWN,3,2},
			{WHITE,PAWN,4,2},
			{WHITE,PAWN,5,2},
			{WHITE,PAWN,6,2},
			{WHITE,PAWN,7,2},		
			
			{BLACK,TOWER,0,0},
			{BLACK,TOWER,7,0},
			{BLACK,KING,3,7},
			{BLACK,HORSE,1,7},
			{BLACK,HORSE,6,7},
			{BLACK,QUEEN,4,7},
			{BLACK,RUNNER,2,7},
			{BLACK,RUNNER,5,7},
			{BLACK,PAWN,0,6},
			{BLACK,PAWN,1,6},
			{BLACK,PAWN,2,6},
			{BLACK,PAWN,3,6},
			{BLACK,PAWN,4,6},
			{BLACK,PAWN,5,6},
			{BLACK,PAWN,6,6},
			{BLACK,PAWN,7,6}
			
	};
	
	
	Player p1;
	Player p2;

	public Board(Player p1,Player p2)
	{
		figures = new ArrayList<Figure>();
		
		
		for(int i=0; i< initializationList.length; i++)
		{
			int x = initializationList[i][2];
			int y = initializationList[i][3];
			int z= initializationList[i][0];
			
			switch(initializationList[i][1])
			{
			  case KING:
				  figures.add(new King(z,x,y));
			
			  case HORSE:
				  figures.add(new Horse(z,x,y));
				  
			  case RUNNER:
				  figures.add(new Runner(z,x,y));
				  
			  case PAWN:
				  figures.add(new Pawn(z,x,y));
				  
			  case QUEEN:
				  figures.add(new Queen(z,x,y));  
				  
			  case TOWER:
				  figures.add(new Tower(z,x,y)); 
			}
			
		}
		
		
	}
}
